gh-141510 Document and test frozendict class matching behaviour#150799
Conversation
Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly with the single-arg class matching. However it isn't documented in the list of classes this works with and it isn't tested. The test is some way below the other similar tests but anything else would need a large renumbering
|
I'm assuming this is fine to bundle onto the original frozendict issue, but can change that if needed (...Although I originally linked it to a previous reject proposal by mistake...) |
Documentation build overview
118 files changed ·
|
| self.assertEqual(x, 0) | ||
| self.assertEqual(y, 1) | ||
|
|
||
| def test_patma_267(self): |
There was a problem hiding this comment.
I don't know the rationale for using an identifier to name the test method. Can you rename it to test_patma_frozendict()?
|
Oh, I didn't notice that I copied |
I guess it isn't too late to remove the flag of you don't want it. But I think the flag makes sense. I've updated the function name to be more descriptive |
|
Thanks, I merged your change. |
|
GH-151701 is a backport of this pull request to the 3.15 branch. |
GH-150799) (#151701) gh-141510 Document and test frozendict class matching behaviour (GH-150799) Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly with the single-arg class matching. However it isn't documented in the list of classes this works with and it isn't tested. The test is some way below the other similar tests but anything else would need a large renumbering. (cherry picked from commit fd53ae1) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Frozendict has
_Py_TPFLAGS_MATCH_SELFset so works correctly with the single-arg class matching. However it isn't documented in the list of classes this works with and it isn't tested.The test is some way below the other similar tests but anything else would need a large renumbering